#include "GameState.h"

#include "../items/ChangeStateButton.h"
#include "../states/TitleState.h"

GameState* GameState::theGameState = NULL;

GameState::GameState(Frame *aFrame) {
    this->theTitle = "Hangman!";
	this->theFrame = aFrame;
}

GameState::~GameState() {
}

void GameState::populate() {
	ChangeStateButton *quit = new ChangeStateButton('4', "quit", TitleState::getInstance(this->theFrame));
	this->theItems.push_back(quit);
}

GameState& GameState::getInstance(Frame *aFrame) {
	if(GameState::theGameState == NULL) {
		GameState::theGameState = new GameState(aFrame);
		GameState::theGameState->populate();
		aFrame->insertState(GameState::theGameState);
	}
    return *GameState::theGameState;
}
